from socket import *

sock = socket()
sock.bind(("0.0.0.0", 6888))
sock.listen()

while True:
    conn, addr = sock.accept()
    print("Connect from", addr)

    data = conn.recv(1024)
    print(data.decode())
    response = "HTTP/1.1 200 OK\r\n"
    response += "Content-Type: text/html\r\n"
    response += "\r\n"
    response += "<h1>Hello world</h1>"
    conn.send(response.encode())
    conn.close()

sock.close()
